package com.ztf.room.service.imp;

import com.ztf.room.bean.RoomAdmin;
import com.ztf.room.dao.AdminDao;
import com.ztf.room.exception.BusinessException;
import com.ztf.room.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class adminServiceImp implements AdminService {
    @Autowired
    private AdminDao adminDao;
    @Override
    public RoomAdmin login(String account, String password) {
        RoomAdmin admin = adminDao.login(account,password);
        if (admin==null){
            throw new BusinessException("密码或账号错误");
        }
        return admin;
    }
}
